package sxe.core.math;

import snobject.snDouble;
import snobject.snObject;
import snobject.snObjectArgList;
import step.FunctionWrapper;
import step.EvaluationFailure;

/**
 * Returns Euler's number e raised to the power of a double value.
 * @param argv must contain an snDouble object at top of the stack
 * @return returns the value e^a, where e is the base of the natural logarithms
 */

public class exp extends FunctionWrapper{
	
	public snObject Call(snObjectArgList argv) throws EvaluationFailure{
		// REQUIRES: argv must contain an snDouble object at top of the stack representing an angle in radians
		// EFFECTS: returns the snDouble of the value e^a, where e is the base of the natural logarithms
		double ret = argv.popDouble().getDbl();
		
		return new snDouble(Math.exp(ret));
	}
}